﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FL.Lite;
using System.Data.SqlClient;
using System.Data;
using System.Collections;

namespace FL.Lite
{
    public static class DBHelper
    {
        private static string _commonConnectionString;

        public static string CommonConnectionString
        {
            get
            {
                if (_commonConnectionString == null)
                {
                    string conString = "defualtConnString";

                    _commonConnectionString =System.Configuration.ConfigurationManager.AppSettings[ conString];
                }
                return _commonConnectionString;
            }
        }

        public static IDb CreateDb()
        {
            return CreateDb(CommonConnectionString);
        }

        public static IDb CreateDb(string connectionStringName)
        {
            return new FL.Lite.sqlserver.SqlProvider(CommonConnectionString).OpenDb();
        }
    }


}
